<meta charset="utf-8">
<div class="box box-primary" id="pmpTasks_add"
	style="max-width: 1200px;">
	<form role="form" id="editForm" class="form-horizontal">
		<div class="box-body">
			<div class="form-group">
				<label>任务名称</label>
				<div class="col-sm-10">
					<input type="text" name="taskName" v-model="pmpTasks.taskName"
						class="form-control" id="taskName" required />
				</div>
			</div>

			<div class="form-group">
				<label>任务详情</label>
				<div class="col-sm-10">
					<input type="text" name="taskDetail" v-model="pmpTasks.taskDetail"
						class="form-control" id="taskDetail" required />
				</div>
			</div>

			<div class="form-group">
				<label>评估时间</label>
				<div class="col-sm-10">
					<input type="text" name="assignHours"
						v-model="pmpTasks.assignHours" class="form-control"
						id="assignHours"  />
				</div>
			</div>
			<div class="form-group">
				<label>截止时间</label>
				<div class="col-sm-10">
					<input type="datetime" name="expireTime"
						v-model="pmpTasks.expireTime" class="form-control" id="expireTime"
						required />

				</div>
			</div>
			<div class="form-group">
				<label>难度系数</label>
				<div class="col-sm-10">
					<select id="difficultyScoreId" name="difficultyScoreId"
						v-model="pmpTasks.difficultyScoreId"
						v-kselect="{url:'/pmp/service/pub/pmpALine/loadDifScoreComboboVo',vmodel:'pmpTasks.difficultyScoreId',firstEmpty:'true'}"
						class=" form-control">
					</select>
				</div>
			</div>
			<div class="form-group">
				<label> 优先级</label>
				<div class="col-sm-10">
					<input type="number" min="1" name="priority"
						v-model="pmpTasks.priority" class="form-control" id="priority"
						 />
				</div>
				<div class="form-group">
					<label>是否来源于需求</label>
					<div class="col-sm-10">
						<select v-model="pmpTasks.fromRequire" id="fromRequire"
							name="fromRequire" class="form-control" required>
							<option value="1">是</option>
							<option value="2">否</option>
						</select>
					</div>
				</div>
				<div class="form-group">
					<label> 来源需求</label>
					<div class="col-sm-10">
						<select id="requireId" name="requireId"
							v-model="pmpTasks.requireId"
							v-kselect="{url:'/pmp/service/pub/pmpRequires/loadPmpRequiresComboboVo',vmodel:'pmpTasks.requireId',firstEmpty:'true'}"
							class=" form-control"></select>
					</div>
				</div>
				<div class="form-group">
					<label>任务负责人</label>
					<div class="col-sm-10">
						<select type="text" name="chargeUserId"
							v-model="pmpTasks.chargeUserId"
							v-kselect="{url:'/pmp/service/ma/pmpCloudMember/loadCloudMemberComboboVo',vmodel:'pmpTasks.chargeUserId',firstEmpty:'true'}"
							class="form-control" id="chargeUserId">
						</select>
					</div>
				</div>
			</div>
		</div>
		<div class="box-footer">
			<button type="button" class="btn btn-default" v-on:click="cancle">取消</button>
			<button type="button" class="btn btn-info pull-right"
				v-on:click="add">提交</button>
		</div>
	</form>
	<script type="text/javascript">
		var news = new Vue({
			el : '#pmpTasks_add',
			data : {
				pmpTasks : {
					projectId : null,
					projectVersionId : null,
					taskName : null,
					taskDetail : null,
					fromRequire : null,
					requireId : null,
					chargeUserId : null,
					assignHours : null,
					difficultyScoreId : null,
					priority : null,
					expireTime : null
				},
				bus : new Vue(),
			},
			mounted : function() {
				var _this = this;
				var param = zfesLayerEditDg.getLayerParam();//projectId projectVersionId  
				_this.pmpTasks.projectId = param.projectId;
				_this.pmpTasks.projectVersionId = param.projectVersionId;
			},
			methods : {
				add : function() {
					if ($("#editForm").valid()) {
						let _this = this;
						let url = "/pmp/service/pm/pmpTasks/createPmpTasks";
						zfesAjax.ajaxTodo(url, _this.$data.pmpTasks, function(
								data) {
							alertSwal.successText(data.message);
							layer.close(layer.index);
						})
					}
				},
				cancle : function() {
					layer.close(layer.index);
				}
			}
		});
	</script>
</div>
